/**
 * inforcreation.com co.Ltd
 * MichaelHuang
 * 2011-12-22
 */
package com.zchat.android.handler.db;

import java.util.List;

/**
 * data handler interface
 * @author MichaelHuang
 *
 */
public interface DBHandler<T> {

	/**
	 * add in database
	 * @param obj
	 */
	public void add(T obj);
	
	/**
	 * delete from database
	 * @param obj
	 */
	public void delete(T obj);
	
	/**
	 * update database record
	 * @param obj
	 */
	public void update(T obj);
	
	/**
	 * query info from database.
	 * @param obj
	 * @return
	 */
	public T query(T obj);
	
	/**
	 * batch operations
	 * @param objs
	 */
	public void batch(List<T> addObjs, List<T> updateObjs, List<T> deleteObjs);
	
	/**
	 * delete all
	 */
	public void clear();
	
	public List<T> queryAll();
	
}
